import r1 from "./request";

// 请求首页数据

export const GetHomeData = () => r1.get("/index/index");

//获取搜索窗口的数据
export const GetPopupData = () => r1.get("/search/index");

//  搜索框的数据
export const GetSearchData = params => r1.get("/goods/list", { params });

// get请求的params需要解构赋值，而post不用
// export const GetSearchData = (params) => r1.post('/goods/list',params)

// 获取实时搜索功能
export const GetTimeData = params => r1.get("/search/helper", { params });

// 清除历史记录
export const ClearHistory = () => r1.post("/search/clearhistory");

// 登录接口
export const GoLogin = params => r1.post("/auth/loginByWeb", params);

// 产品明细
export const GetGoodsDetail = (params) => r1.get('/goods/detail',{params})

// 相关产品
export const GetAboutShop = (params) => r1.get('/goods/related',{params})

// 获取购物车产品数量
export const GetGoodsNum = () => r1.get('/cart/goodscount')

// 加入购物车
export const GetAddCart = (params) => r1.post('/cart/add',params)

// 获取购物车数据
export const GetCartData = () => r1.get('/cart/index')

// 点击切换商品选中状态
export const GetGoodsClick = (params) => r1.post('/cart/checked',params)

// 商品步进器
export const GetStepper = (params) => r1.post('/cart/update',params)

// 商品的删除
export const GetShopDelete = (params) => r1.post('/cart/delete',params)


